package com.leyou.test.exceptions;

import com.leyou.test.enums.ExceptionEnum;
import lombok.Getter;

/**
 * 自定义异常
 */
@Getter
public class LyException extends RuntimeException {
    private int status;

    public LyException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMessage());
        this.status = exceptionEnum.getStatus();
    }

    public LyException(ExceptionEnum exceptionEnum,Throwable cause) {
        super(exceptionEnum.getMessage());
        this.status = exceptionEnum.getStatus();
    }

    public LyException(int status, String message) {
        super(message);
        this.status = status;
    }

    public LyException(int status, String message,Throwable cause) {
        super(message);
        this.status = status;
    }

    /*public LyException() {
    }

    public LyException(int status, String message) {
        super(message);
        this.status = status;
    }

    public LyException(int status, String message, Throwable cause) {
        super(message, cause);
        this.status = status;
    }*/
}
